package cn.wolfcode.luowowo.gold.service.impl;

import cn.wolfcode.luowowo.gold.domain.GoldProductDetail;
import cn.wolfcode.luowowo.gold.repository.GoldProductDetailRepository;
import cn.wolfcode.luowowo.gold.service.IGoldProductDetailService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

import java.util.List;

/**
 * @author 猫教授
 * @date 2019/8/25 0:51
 */
@Service
public class GoldProductDetailServiceImpl implements IGoldProductDetailService {
    @Autowired
    private GoldProductDetailRepository repository;
    @Autowired
    private MongoTemplate template;

    @Override
    public void save(GoldProductDetail detail) {
        repository.save(detail);
    }

    @Override
    public List<String> findByProductId(Long productId) {

        return repository.findByProductId(productId).getDetail();
    }
}
